package com.crm.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.ActionSupport;

public class SendMsgByAjax extends ActionSupport {
	private static final long serialVersionUID = 1L;
	
	public static void sendStringMsg(HttpServletResponse response, String msg) throws IOException {
		response.setContentType("text/html;charset=UTF-8");
		response.setCharacterEncoding("UTF-8");
		PrintWriter out = response.getWriter();
		out.println(msg);
		out.flush();
		out.close();
	}
	
	public static void sendJsonMsg(HttpServletResponse response, Object obj) {
		response.setContentType("application/json;charset=UTF-8");
		response.setCharacterEncoding("UTF-8");
	}
}
